package com.cdy.controller;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cdy.entity.Class;
import com.cdy.service.IClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 崔德渊
 * @since 2022-03-08
 */
@RestController
@RequestMapping("/class")
public class ClassController {

    @Autowired
    private IClassService iClassService;

    @GetMapping("/")
    public List<Class> selectAll(){
        List<Class> list = iClassService.selectAll();
        return list;
    }
    @PostMapping("/add")
    public void insertClass(@RequestBody Class clazz){
        iClassService.save(clazz);
    }



}

